package com.kirk.cts.core.runcycle.support;

import com.kirk.cts.core.runcycle.schedule.ScheduleEnum;
import com.kirk.cts.core.runcycle.schedule.processor.IStartScheduleProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.List;
import java.util.TreeSet;

/**
 * <p> StartSchedule.java </p>
 *
 * @version 1.0.0
 * @Author kirkliu
 * @Date 2020-08-30 16:34
 * @Description 开始计划
 */
@Component("startSchedule")
public class StartSchedule extends AbstractSchedule<IStartScheduleProcessor> {

    @Autowired
    private List<IStartScheduleProcessor> startScheduleProcessor;

    @Override
    public ScheduleEnum getSchedule() {
        return ScheduleEnum.START;
    }


    @Override
    protected Collection<IStartScheduleProcessor> getScheduleProcessors() {
        if (null != this.startScheduleProcessor) {
            return new TreeSet<IStartScheduleProcessor>(this.startScheduleProcessor);
        }
        return null;
    }

    public void setStartScheduleProcessor(
            List<IStartScheduleProcessor> startScheduleProcessor) {
        this.startScheduleProcessor = startScheduleProcessor;
    }


}
